package com.fastloan.mgt.jx.model.dto;

import javax.validation.constraints.NotNull;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * 预授信查询请求
 *
 * @author chenkai
 * createTime 2018-01-2018/1/7 16:35
 */
public class JxSeCreditDTO {
    /**
     * 身份证号
     */
    private String card_id;

    /**
     * 机构编号
     */
    @NotNull
    private String agent_id;

    /**
     * 用户名
     */
    private String user_id;

    /**
     * 我方流水号
     */
    private String order_no;

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getAgent_id() {
        return agent_id;
    }

    public void setAgent_id(String agent_id) {
        this.agent_id = agent_id;
    }

    public String getCard_id() {
        return card_id;
    }

    public void setCard_id(String card_id) {
        this.card_id = card_id;
    }


    @Override
    public String toString() {
        return new StringJoiner(", ", this.getClass().getSimpleName() + "[", "]")
                .add("agent_id = " + agent_id)
                .add("card_id = " + card_id)
                .toString();
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        JxSeCreditDTO that = (JxSeCreditDTO) o;

        return Objects.equals(this.agent_id, that.agent_id) &&
                Objects.equals(this.card_id, that.card_id) &&
                Objects.equals(this.order_no, that.order_no) &&
                Objects.equals(this.user_id, that.user_id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(agent_id, card_id, order_no, user_id);
    }
}
